<?php

namespace App\Http\Controllers;

use App\Http\Service\Douban\DoubanpostService;
use App\Http\Service\ViewcountService;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\DB;
#浏览历史记录
class ViewcountController extends BaseController
{
    private $getRules=[
            'unique_id'=> 'required',
        ];
    private  $getRulesMessage=[
            'unique_id.required'=> '唯一标识【unique_id】不能为空',
        ];

    public $repository;
    public function __construct(ViewcountService $repository)
    {
        parent::__construct();
        $this->repository = $repository;

    }

    /**
     *  监控-列表
     *  
     * @param Request $request
     * @return JsonResponse
     */
    public function getList(Request $request)
    {
        $data=[
            'type'=>$request->input("type"),
            'type_son'=>$request->input("type_son"),
            'today_time'=>$request->input("today_time"),
            'people_id'=>$request->input("people_id"),
            'title'=>$request->input("title"),
        ];
        
        $this->success($this->repository->getList($request,$data));
    }

    // 历史记录-删除
    public function del(Request $request)
    {
        $ids = $request->json('id');
        if(empty($ids)){
            $this->error('参数错误');
        }
        $data=[
        
        ];
        $this->repository->del($request,$data,$ids);
    }





    

  

}
